let list = {
    getkeypath:[],
    userinfo:{token:''},
    gjc:[],
    student:[]
  }
   let reducer =(state=list,action)=>{
      var newstate = JSON.parse( JSON.stringify( state ) );
      if(action.type=='BIANJI'){
          newstate.student = action.payload
          return newstate
      }
      else if(action.type=='SAVETOKEN'){
          newstate.userinfo = action.payload;
         return newstate
      }else if(action.type == 'ADD'){
        var user = {...action.payload}
        user.id = newstate.gjc.length+1
        user.key = newstate.gjc.length+1
        newstate.gjc.push(user)
        return newstate
      }
      return state
   }
   export default reducer